const path = require('path');
const {VueLoaderPlugin} = require("vue-loader");
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: './src/main.js', //入口模块，会根据模块依赖关系，建立依赖图
  
  module: {
    rules: [
      {
        test: /\.vue$/,
        loader: 'vue-loader'
      }
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      title: '生成index.html',
	  template:"./public/index.html"
    }),
	new VueLoaderPlugin()
  ],
  output: {               //输出位置、名称
    filename: 'app.js',
    path: path.resolve(__dirname, 'dist'),
  },
};